%--------------------------------------------------------------------------
% 1. Declare Endogenous, Exogenous Variables, and Parameters
%--------------------------------------------------------------------------

% endogenous variables
var G_output G_C G_INV G_H G_TFP G_R_ratio G_P_share G_pi;
var ALPHA_0 G_prod_disp G_DM_price G_w G_Z G_iota G_prod ; % ALPHA_0 is varying because of endogenous entry
var B K_bar c_star INV Y IM pi R_ratio P_share Productivity TFP;
var K Z H E_a E_p w r iota; 
var q_capital q_money q_profit q_liq L surplus_net;
var DM_price prod_disp;

% exogenous variables
var Chi_q Mu G A;

% exogenous shocks
varexo e_CREDIT e_A e_Mu e_G; 

% Parameters that affect the steady state
parameters BETA SIGMA ETA tau_k tau_h XI MU DELTA THETA ALPHA CHI_q CHI_k CHI_PI CHI_PI_k;
parameters ZETA;
parameters EPS_L_BOUND, EPS_H_BOUND, S_PARAM, M_PARAM;

parameters c_mu c_sig;

% shocks
parameters RHO_CREDIT RHO_A RHO_MU  RHO_G;
parameters SIGMA_CREDIT SIGMA_A SIGMA_MU SIGMA_G;

% steady-state values
parameters B_SS W_SS K_BAR_SS C_STAR_SS G_SS A_SS ALPHA_0_SS;
parameters DM_price_SS prod_disp_SS E_a_SS E_p_SS R_ratio_SS P_share_SS Y_SS;
parameters K_SS Z_SS L_SS q_capital_SS q_money_SS q_profit_SS q_liq_SS surplus_SS q_average_prod a;



%--------------------------------------------------------------------------
% 2. Load Exogenous Parameters
%--------------------------------------------------------------------------

load params;

% -------------------------- Model Parameters
set_param_value('BETA'          ,par.BETA);
set_param_value('SIGMA'         ,par.SIGMA);
set_param_value('ETA'           ,par.ETA);
set_param_value('G_SS'          ,par.G);
set_param_value('tau_k'         ,par.tau_k);
set_param_value('tau_h'         ,par.tau_h);
set_param_value('XI'            ,par.XI);
set_param_value('A_SS'          ,par.A);
set_param_value('MU'            ,par.MU);
set_param_value('DELTA'         ,par.DELTA);
set_param_value('THETA'         ,par.THETA);
set_param_value('ALPHA'         ,par.ALPHA);

set_param_value('c_mu'          ,par.c_mu);
set_param_value('c_sig'         ,par.c_sig);
set_param_value('surplus_SS'    ,par.surplus_SS);

set_param_value('CHI_q'         ,par.CHI_q);
set_param_value('CHI_k'         ,par.CHI_k);
set_param_value('CHI_PI'        ,par.CHI_PI);
set_param_value('CHI_PI_k'      ,par.CHI_PI_k);
set_param_value('EPS_L_BOUND'   ,par.EPS_L_BOUND);
set_param_value('EPS_H_BOUND'   ,par.EPS_H_BOUND);
set_param_value('S_PARAM'       ,par.S_PARAM);
set_param_value('M_PARAM'       ,par.M_PARAM);
set_param_value('ZETA'          ,par.ZETA);
set_param_value('B_SS'          ,par.B_SS);
set_param_value('L_SS'          ,par.L_SS);
set_param_value('W_SS'          ,par.W_SS);
set_param_value('K_BAR_SS'      ,par.K_BAR_SS);
set_param_value('C_STAR_SS'     ,par.C_STAR_SS);
set_param_value('DM_price_SS'   ,par.DM_price_SS);
set_param_value('prod_disp_SS'  ,par.prod_disp_SS);
set_param_value('ALPHA_0_SS'    ,par.ALPHA_0_SS);
set_param_value('E_a_SS'        ,par.E_a_SS);
set_param_value('E_p_SS'        ,par.E_p_SS);
set_param_value('R_ratio_SS'    ,par.R_ratio_SS);
set_param_value('P_share_SS'    ,par.P_share_SS);
set_param_value('Y_SS'          ,par.Y_SS);
set_param_value('K_SS'          ,par.K_SS);
set_param_value('Z_SS'          ,par.Z_SS);
set_param_value('q_capital_SS'        ,par.q_capital_SS);
set_param_value('q_money_SS'          ,par.q_money_SS);
set_param_value('q_profit_SS'         ,par.q_profit_SS);
set_param_value('q_liq_SS'            ,par.q_liq_SS);
set_param_value('q_average_prod'      ,par.q_average_prod);
set_param_value('a'                   ,par.a);

set_param_value('RHO_CREDIT'     ,par.RHO_CREDIT);
set_param_value('RHO_A'          ,par.RHO_A);
set_param_value('RHO_MU'         ,par.RHO_MU);
set_param_value('RHO_G'          ,par.RHO_G);
set_param_value('SIGMA_CREDIT'   ,par.SIGMA_CREDIT);
set_param_value('SIGMA_A'        ,par.SIGMA_A);
set_param_value('SIGMA_MU'       ,par.SIGMA_MU);
set_param_value('SIGMA_G'        ,par.SIGMA_G);
